#include<stdio.h>
#include<unistd.h>
#include<string.h>

#define NUM 102

int main(void)
{
    char bar[NUM];
    memset(bar,0,sizeof(bar));
    
    const char*lable="|/-\\";

    int cen=0;
    while(cen<=100)
    {
        printf("[%-100s][%d%%]%c\r",bar,cen,lable[cen%4]);
        bar[cen++]='#';
        fflush(stdout);
        //sleep(1);
        usleep(30000);
    }
    printf("\n");
    return 0;
}
